//
//  FatherBarController.m
//  CleanerAir_Project
//
//  Created by mac on 16/4/28.
//  Copyright © 2016年 Beijing Colin El Internet. All rights reserved.
//

#import "FatherBarController.h"
#import "homeViewController.h"
#import "Remote_controlViewController.h"
#import "FatherNavigationController.h"
#import "MeViewController.h"
#import "MoreViewController.h"
#import "UIImage+orghtimage.h"

@interface FatherBarController ()

@end

@implementation FatherBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //创建TabBarViewCollers
    [self CreatViewConllers];
    self.tabBar.tintColor=[UIColor whiteColor];//[UIColor colorWithRed:0/255.f green:186/255.f blue:59/255.f alpha:1];
    
    UIView *bgView = [[UIView alloc] initWithFrame:self.tabBar.bounds];
    bgView.backgroundColor = [UIColor blackColor];
    [self.tabBar insertSubview:bgView atIndex:0];
    self.tabBar.opaque = YES;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

// 创建TabBarViewCollers
-(void)CreatViewConllers{

    // 首页
    homeViewController*home=[[homeViewController alloc]init];
    FatherNavigationController*FANHOME=[[FatherNavigationController alloc]initWithRootViewController:home];
    
//    FANHOME.tabBarController.tabBar.backgroundColor = ;

    FANHOME.tabBarItem.image=[UIImage imageNamed:@"地图"].originalImage;
    FANHOME.tabBarItem.selectedImage=[UIImage imageNamed:@"点击地图"].originalImage;
    FANHOME.title=@"空气地图";
    //遥控器页
    Remote_controlViewController*Remote=[[Remote_controlViewController alloc]init];
    FatherNavigationController*FANRemote=[[FatherNavigationController alloc]initWithRootViewController:Remote];
    FANRemote.tabBarItem.image=[UIImage imageNamed:@"遥控"].originalImage;
    FANRemote.tabBarItem.selectedImage=[UIImage imageNamed:@"点击遥控"].originalImage;
    FANRemote.title=@"遥控器";
    
    
    //我页
    MeViewController*me=[[MeViewController alloc]init];
    FatherNavigationController*FANMe=[[FatherNavigationController alloc]initWithRootViewController:me];
  
    FANMe.tabBarItem.image=[UIImage imageNamed:@"我的"].originalImage;
    FANMe.tabBarItem.selectedImage=[UIImage imageNamed:@"点击我的"].originalImage;
    FANMe.title=@"我的";
    //更多
    
    MoreViewController*more=[[MoreViewController alloc]init];
    FatherNavigationController*FANMore=[[FatherNavigationController alloc]initWithRootViewController:more];
    
    FANMore.tabBarItem.image=[UIImage imageNamed:@"更多"].originalImage;
    FANMore.tabBarItem.selectedImage=[UIImage imageNamed:@"点击更多"].originalImage;
    FANMore.title=@"更多";
    
    self.viewControllers=@[FANHOME,FANRemote,FANMe,FANMore];
    
    
  


}

@end
